#include <kanzi/core/profiling/abstract_profiler.hpp>
Public Types | |
enum | DataType { DataTypeNotDefined, DataTypeBoolean, DataTypeUint64, DataTypeFloat, DataTypeString } |
Supported profiling data field value types. More... | |
typedef variant< monostate, bool, uint64_t, float, string > | Value |
Container for profiling data field value. More... | |
Public Member Functions | |
virtual | ~AbstractProfiler () |
Destructor. More... | |
string_view | getName () const |
Gets the name of the profiler. More... | |
const ProfilingCategory & | getCategory () const |
Gets a reference to the profiling category assigned to the profiler. More... | |
size_t | getAggregateDataFieldCount () const |
Gets the number of aggregate data fields. More... | |
string | getAggregateDataFieldName (size_t fieldIndex) const |
Gets the name of an aggregate data field. More... | |
Value | getAggregateDataFieldValue (size_t fieldIndex) const |
Gets the value of an aggregate profiling data field. More... | |
size_t | getSampleFieldCount () const |
Gets the number of sample data fields. More... | |
string | getSampleFieldName (size_t fieldIndex) const |
Gets the name of a data sample field. More... | |
size_t | getSampleCount () const |
Gets the number of collected profiling data samples. More... | |
Value | getSampleFieldValue (size_t sampleIndex, size_t fieldIndex) const |
Gets the value of a profiling data sample field. More... | |
void | logAggregateData () const |
Logs aggregate profiling data. More... | |
void | logAllData () const |
Logs all profiling data. More... | |
Static Public Member Functions | |
static DataType | getDataType (const Value &value) |
Gets the type of the data stored in a profiling data field. More... | |
Protected Member Functions | |
AbstractProfiler (string_view name, const ProfilingCategory &category) | |
Constructor. More... | |
virtual size_t | getAggregateDataFieldCountOverride () const =0 |
To provide the number of the aggregate data fields, override this function in the derived profiler class. More... | |
virtual string | getAggregateDataFieldNameOverride (size_t fieldIndex) const =0 |
To provide the name of aggregate data field with given index, override this function in the derived profiler class. More... | |
virtual Value | getAggregateDataFieldValueOverride (size_t fieldIndex) const =0 |
To provide access to aggregate profiling data field values, override this function in the derived profiler class. More... | |
virtual size_t | getSampleFieldCountOverride () const =0 |
To provide the number of sample fields, override this function in the derived profiler class. More... | |
virtual string | getSampleFieldNameOverride (size_t fieldIndex) const =0 |
To provide the name of a sample field with a given index, override this function in the derived profiler class. More... | |
virtual Value | getSampleFieldValueOverride (size_t sampleIndex, size_t fieldIndex) const =0 |
To provide access to profiling data sample fields of the derived profiler, override this function in the derived profiler class. More... | |
virtual size_t | getSampleCountOverride () const =0 |
To provide the number of profiling data samples stored in the derived profiler, override this function in the derived profiler class. More... | |
virtual void | logAggregateDataOverride () const |
To implement your own logging of aggregate profiling data, override this function in the derived profiler class. More... | |
virtual void | logAllDataOverride () const |
To implement your own logging of all profiling data, override this function in the derived profiler class. More... | |
This is the abstract base class of all profilers. See derived class AbstractValueProfiler for a concrete implementation.
See Profiling macros on how to use your profilers.
To extract profiler samples:
typedef variant<monostate, bool, uint64_t, float, string> kanzi::AbstractProfiler::Value |
Container for profiling data field value.
|
virtual |
Destructor.
|
explicitprotected |
Constructor.
name | The name of the profiler. |
category | The profiling category assigned to the profiler. |
string_view kanzi::AbstractProfiler::getName | ( | ) | const |
Gets the name of the profiler.
const ProfilingCategory& kanzi::AbstractProfiler::getCategory | ( | ) | const |
Gets a reference to the profiling category assigned to the profiler.
size_t kanzi::AbstractProfiler::getAggregateDataFieldCount | ( | ) | const |
Gets the number of aggregate data fields.
Calls getAggregateDataFieldCountOverride() overriden in the derived profiler class.
string kanzi::AbstractProfiler::getAggregateDataFieldName | ( | size_t | fieldIndex | ) | const |
Gets the name of an aggregate data field.
Calls getAggregateDataFieldNameOverride() overriden in the derived profiler class.
fieldIndex | The index of the field. |
Value kanzi::AbstractProfiler::getAggregateDataFieldValue | ( | size_t | fieldIndex | ) | const |
Gets the value of an aggregate profiling data field.
Calls getAggregateDataFieldValueOverride() overriden in the derived profiler class.
fieldIndex | The index of the aggregate profiling data field. |
size_t kanzi::AbstractProfiler::getSampleFieldCount | ( | ) | const |
Gets the number of sample data fields.
Calls getSampleFieldCountOverride() overriden in the derived profiler class.
string kanzi::AbstractProfiler::getSampleFieldName | ( | size_t | fieldIndex | ) | const |
Gets the name of a data sample field.
Calls getSampleFieldNameOverride() overriden in the derived profiler class.
fieldIndex | The index of the sample field. |
size_t kanzi::AbstractProfiler::getSampleCount | ( | ) | const |
Gets the number of collected profiling data samples.
Calls getSampleCountOverride() overriden in the derived profiler class.
Value kanzi::AbstractProfiler::getSampleFieldValue | ( | size_t | sampleIndex, |
size_t | fieldIndex | ||
) | const |
Gets the value of a profiling data sample field.
Calls getSampleFieldValueOverride() overriden in the derived profiler class.
sampleIndex | The index of the profiling data sample. |
fieldIndex | The index of the field of the profiling data sample. |
Gets the type of the data stored in a profiling data field.
value | Profiling data field value. |
|
inline |
Logs aggregate profiling data.
|
inline |
Logs all profiling data.
|
protectedpure virtual |
To provide the number of the aggregate data fields, override this function in the derived profiler class.
Implemented in kanzi::IntervalProfiler, and kanzi::MainLoopTaskProfiler.
|
protectedpure virtual |
To provide the name of aggregate data field with given index, override this function in the derived profiler class.
fieldIndex | The index of the field. |
Implemented in kanzi::IntervalProfiler, and kanzi::MainLoopTaskProfiler.
|
protectedpure virtual |
To provide access to aggregate profiling data field values, override this function in the derived profiler class.
fieldIndex | The index of the aggregate profiling data field. |
Implemented in kanzi::IntervalProfiler, and kanzi::MainLoopTaskProfiler.
|
protectedpure virtual |
To provide the number of sample fields, override this function in the derived profiler class.
Implemented in kanzi::IntervalProfiler, and kanzi::MainLoopTaskProfiler.
|
protectedpure virtual |
To provide the name of a sample field with a given index, override this function in the derived profiler class.
fieldIndex | The index of the field. |
Implemented in kanzi::IntervalProfiler, and kanzi::MainLoopTaskProfiler.
|
protectedpure virtual |
To provide access to profiling data sample fields of the derived profiler, override this function in the derived profiler class.
sampleIndex | The index of the profiling data sample. |
fieldIndex | The index of the field of the profiling data sample. |
Implemented in kanzi::IntervalProfiler, and kanzi::MainLoopTaskProfiler.
|
protectedpure virtual |
To provide the number of profiling data samples stored in the derived profiler, override this function in the derived profiler class.
Implemented in kanzi::AbstractValueProfiler< TProfilingDataSample, TAggregateProfilingData >, kanzi::AbstractValueProfiler< IntervalProfilerSampleData, IntervalProfilerSampleStatistics >, and kanzi::AbstractValueProfiler< MainLoopTaskProfilerSampleData, IntervalProfilerSampleStatistics >.
|
protectedvirtual |
To implement your own logging of aggregate profiling data, override this function in the derived profiler class.
|
protectedvirtual |
To implement your own logging of all profiling data, override this function in the derived profiler class.